package my.design.test.Interpreter;

/**
 * @author zp
 * @version 1.0
 * @description: 非终结符表达式
 * @date 2022/10/30 15:30
 */
public class AndExpression implements Expression{
    private final Expression left;
    private final Expression right;

    public AndExpression(Expression left, Expression right) {
        this.left = left;
        this.right = right;
    }

    @Override
    public boolean interpret(String context) {
        return this.left.interpret(context) && this.right.interpret(context);
    }
}
